import Vue from 'vue'
import App from './App.vue'
import router from './router'
import "./assets/css/global.css"
import "./assets/icon/icons.css"
import './plugins/element.js'
import axios from 'axios'
import * as echarts from 'echarts'
import Nprogress from 'nprogress'
import TreeTabel from 'vue-table-with-tree-grid'
Vue.config.productionTip = false;
axios.defaults.baseURL = "https://www.liulongbin.top:8888/api/private/v1/";
axios.interceptors.request.use(res => {
    Nprogress.start();
    const token = window.sessionStorage.getItem('token')
    if (token) {
        res.headers.Authorization = token;
    }
    return res;
})
axios.interceptors.response.use(res=>{
    Nprogress.done();
    return res;
})
Vue.prototype.$http = axios;
Vue.prototype.$echarts=echarts;
Vue.component('tree-table', TreeTabel)
new Vue({
    router,
    render: h => h(App)
}).$mount('#app')